<?php
include_once("codelibrary/inc/functions.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>

<body>
<form name="datefrm" action="sampledatescript.php" method="post">
<?php
$today_date = date("Y-m-d");
datelisting($today_date);

if(isset($_REQUEST['day']) && $_REQUEST['day']!='')
{
    $displayed_day = $_REQUEST['day'];
}
else
{
    $displayed_day = date("d");
}
if(isset($_REQUEST['month']) && $_REQUEST['month']!='')
{
    $displayed_month = $_REQUEST['month'];
}
else
{
    $displayed_month = date("n");
}
if(isset($_REQUEST['year']) && $_REQUEST['year']!='')
{
    $displayed_year = $_REQUEST['year'];
}
else
{
    $displayed_year = date("Y");
}
echo "<br/>";
$month_desc = date ("M", mktime(0, 0, 0, $displayed_month, $displayed_day, $displayed_year));
$weekday = date("l", mktime(0, 0, 0, $displayed_month, $displayed_day, $displayed_year));
echo $weekday." ".$month_desc." ".$displayed_day.", ".$displayed_year;
?>
<input type="submit" name="Go" value="Go" />
</form>
</body>
</html>
